const Rx = require('rxjs')

// ```js
// function foo() {
//   console.log('Hello');
//   return 42;
// }
// var x = foo.call(); // 等同于 foo()
// console.log(x);
// var y = foo.call(); // 等同于 foo()
// console.log(y);
// ```

var observable = new Rx.Observable(function (observer) {
  console.log('Hello');
  observer.next(42);
})

console.log('just before subscribe');
observable.subscribe(function (x) {
  console.log(x)
})

observable.subscribe(function (y) {
  console.log(y)
})
console.log('just after subscribe');

// subscribe 就相当于执行函数


